#!/bin/bash

APP=ODS
hive=/opt/services/apache-hive-2.3.7-bin/bin/hive

if [ -n "$1" ]
then
  do_date=$1
else
  do_date=`date -d "-1 day" +%F`
fi

sql="
alter table "$APP".ods_start_log add partition(dt='$do_date');
"

$hive -e "$sql"
